package lanqiao.dontaiguihua.moni;
//顺子日期
public class Lan2096 {
    public static void main(String[] args) {
        int count=0;
        for(int i=1;i<=12;i++){
            for(int j=1;j<=31;j++){
                int[] a={i/10,i%10,j/10,j%10};
                if(a[0]==a[1]-1&&a[1]-1==a[2]-2&&a[2]-2==a[3]-3){
                    count++;
                    continue;
                }
                if((a[0]==a[1]-1&&a[1]-1==a[2]-2)){
                 count++;
                }else if((a[1]-1==a[2]-2&&a[3]-3==a[2]-2)){
                    count++;
                }
            }
        }
        System.out.println(count);
    }
}
